package com.orange.app.config;

import java.util.regex.Pattern;

import org.jasig.cas.client.authentication.UrlPatternMatcherStrategy;
/**
 * 用于过滤掉不需要授权登录的页面
 * @author yesen
 *
 */
public class SimpleUrlPatternMatcherStrategy implements UrlPatternMatcherStrategy {
    private Pattern pattern;

	public boolean matches(String url) {
        //使用正则表达式来匹配需要忽略的连接
        return this.pattern.matcher(url).find();
	}

	/**
	 * 正则表达式的规则，该规则在配置AuthenticationFilter的ignorePattern中设置
	 */
	public void setPattern(String pattern) {
        this.pattern = Pattern.compile(pattern);
	}

}
